package com.gin.supermarket_inventory_system.inventory.dto.param;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gin.database.dto.param.BasePageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

/**
 * 结算分页查询参数
 * @since : 2023/10/16 17:15
 * @author : ginstone
 * @version : v1.0.0
 **/
@Getter
@Setter
@Schema(description = "结算分页查询参数")
public class SettlementPageParam extends BasePageParam {
    @Schema(description = "起始日期,格式: yyyy-MM-dd 或 yyyy-MM")
    String start;
    @Schema(description = "结束日期,格式: yyyy-MM-dd 或 yyyy-MM")
    String end;


    @Override
    public void handleQueryWrapper(QueryWrapper<?> queryWrapper) {
        if (start != null) {
            queryWrapper.ge("date", start);
        }
        if (end != null) {
            queryWrapper.le("date", end);
        }
    }
}
